package com.sixmac.system.controller;

import com.sixmac.core.toolbox.kit.JsonKit;
import com.sixmac.core.toolbox.support.Convert;
import org.junit.Test;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import com.sixmac.core.base.controller.CurdController;
import com.sixmac.core.meta.IMeta;
import com.sixmac.system.meta.factory.AttachFactory;
import com.sixmac.common.model.system.Attach;

import java.util.Arrays;
import java.util.Map;

@Controller
@RequestMapping("/attach")
public class AttachController extends CurdController<Attach> {

    @Override
    protected Class<? extends IMeta> metaFactoryClass() {

        return AttachFactory.class;
    }

    @Test
    public void te() {
        String json = "{\"rtMsg\":\"添加成功\",\"rtCode\":12,\"pointSum\":200,\"taskInfo\":{\"amount\":200,\"beginTime\":\"2018-04-28T13:45:21\",\"countNum\":200,\"createTime\":\"2018-04-28T13:46:49\",\"currentNum\":0,\"cycle\":0,\"distCountNum\":0,\"distNum\":0,\"distType\":1,\"id\":661440,\"isReal\":1,\"parentId\":0,\"pointSum\":200,\"rate\":0,\"repeatNum\":1,\"shopId\":\"0\",\"status\":0,\"taskName\":\"hello\",\"type\":5,\"url\":\"1\",\"userId\":1590}}\n";
        Map<String, String> map11 = JsonKit.parse(json, Map.class);
        String s = map11.get("rtCode");
        System.out.print(s);


    }

}
